const Controller = require('../../core/controller/ApiController');
const {Route, HttpGet, HttpPost, Middleware, filters} = require('../../../plugin/egg-decorator-router/lib');
const {ExceptionHandler} = require('../../../plugin/egg-controller-exception-handler/lib');

@Route('/api/parent/user')
class UserCtrl extends Controller {

    //家长登录
    @HttpPost('/login')
    @ExceptionHandler()
    async parentLogin() {
        const rule = {
            account:'string',
            pwd:'string'
        };
        this.validate(rule,this.ctx.request.body);
        this.result.data = await this.service.parent.user.main.parentLogin(this.ctx.request.body);
        return '登录成功'
    }



}


module.exports = UserCtrl;
